﻿using System;
using System.Data;
using System.Web;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using AnyOffice.Components;
using AnyOffice.DAL;
namespace AnyOffice.general.netdisk
{
    public partial class index : ModulePage
    {
        
        protected void Page_Load(object sender, EventArgs e)
        {
            DataTable table = new NetdiskDao().SelectAll(base.Conn);
            UserCache cache = new UserCache();
            DataView defaultView = table.DefaultView;
            string str = "(Type = 1)";
            str = ((((((str + " OR ((Type = 2) AND (',' + PostDept LIKE '%," + cache.DeptId.ToString() + ",%'))") + " OR ((Type = 3) AND (',' + AccessUser LIKE '%," + base.User.Identity.Name + ",%'))") + " OR (',' + NewUser LIKE '%," + base.User.Identity.Name + ",%')") + " OR (',' + ReadUser LIKE '%," + base.User.Identity.Name + ",%')") + " OR (',' + EditUser LIKE '%," + base.User.Identity.Name + ",%')") + " OR (',' + DownloadUser LIKE '%," + base.User.Identity.Name + ",%')") + " OR (',' + ManageUser LIKE '%," + base.User.Identity.Name + ",%')";
            defaultView.RowFilter = str;
            if (defaultView.Count == 0)
            {
                this.litMessage.Text = base.ShowMessage("无共享目录");
            }
            else
            {
                this.rptNetdisk.DataSource = defaultView;
                this.rptNetdisk.DataBind();
            }
        } 

    }
}
